package com.dly.file;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class InputOutputStreamTest {
	
	public static void main(String[] args) throws IOException {
		
		FileInputStream fis=new FileInputStream("D:/home/a.txt");
		FileOutputStream fos=new FileOutputStream("D:/house/a.txt");
//		System.out.println((char)fis.read());
		
		StringBuilder sb=new StringBuilder();
		
		
		/*String st="hello java";
		
		byte[] b=st.getBytes();
		fos.write(b, 0, st.length());
		*/
		
		byte[] b=new byte[1024];
		int a=0;
		StringBuilder s=null;
		while((a=fis.read(b))!=-1){
//			s=sb.append((char)a);
			fos.write(b, 0, a);
		}
		
		fis.close();
		fos.close();
//		System.out.println(s);
		
	}
}
